package cn.org.farseer.sweetftp.rcp.listener;

import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.DropTargetListener;

import cn.org.farseer.sweetftp.rcp.ui.FileBrowser;


/**
 * 作者 : [Farseer.org] 简洋  —  2009-7-24
 * 
 * 项目 : [Farseer.org] SweetFTP
 */
public class FileDropListener implements DropTargetListener
{
	private FileBrowser fileBrowser;
	public FileDropListener(FileBrowser fileBrowser)
	{
		this.fileBrowser = fileBrowser;
	}

	public void dragEnter(DropTargetEvent event)
	{
	}

	public void dragLeave(DropTargetEvent event)
	{
	}

	public void dragOperationChanged(DropTargetEvent event)
	{
	}

	public void dragOver(DropTargetEvent event)
	{
	}

	public void drop(DropTargetEvent event)
	{
		System.out.println("drop");
		String[] files = (String[])event.data;
		this.fileBrowser.copyFiles(files);
		fileBrowser.reflush(); 
	}

	public void dropAccept(DropTargetEvent event)
	{
	}



}
